<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0077)https://login.dangdang.com/register.php?returnurl=http://myhome.dangdang.com/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>新用户注册 - 当当网</title>

<script type="text/javascript" src="{{asset('login/jquery-1.8.2.min.js')}}"></script>
<link type="text/css" href="{{asset('register/register_150706.css')}}" rel="stylesheet">
</head>
<body>
<link href="{{asset('register/unite_header_1129.css')}}" rel="stylesheet" type="text/css">
<div class="ddnewhead_wrap">
	<div class="ddnewhead_content ddnewhead_content2">
		<div class="ddnewhead_operate" id="__ddnav_menu">
			<ul class="ddnewhead_operate_nav">
				<li class="ddnewhead_cart"><a name="t_1" href="#">购物车<span id="cart_items_count" class="cart_num"></span></a></li>
				<li class="ddnewhead_separate"></li>
				<li><a name="t_2" href="#" target="_blank">我的订单</a></li>
				<li class="ddnewhead_separate"></li>
				<li class="ddnewhead_mydd"><a name="t_3" href="#" target="_blank" class="menu_btn" id="a_myddchannel" onmouseover="showgaoji(&#39;a_myddchannel&#39;,&#39;__ddnav_mydd&#39;)" onmouseout="hideotherchannel(&#39;a_myddchannel&#39;,&#39;__ddnav_mydd&#39;);">我的当当</a>
				<div class="ddnewhead_mydd_panel" onmouseover="showgaoji(&#39;a_myddchannel&#39;,&#39;__ddnav_mydd&#39;)" onmouseout="hideotherchannel(&#39;a_myddchannel&#39;,&#39;__ddnav_mydd&#39;);" id="__ddnav_mydd">
					<ul class="ddnewhead_mydd_list">
						<li><a name="t_3_1" href="#" target="_blank">我的订单</a></li>
						<li><a name="t_3_2" href="#" target="_blank">购物礼券</a></li>
						<li><a name="t_3_3" href="#" target="_blank">我的积分</a></li>
						<li><a name="t_3_4" href="#" target="_blank">我的收藏</a></li>
						<li><a name="t_3_5" href="#" target="_blank">我的评论</a></li>
						<li><a name="t_3_6" href="#" target="_blank">数字商品</a></li>
					</ul>
				</div>
				</li>
				<li class="ddnewhead_separate"></li>
				<li class="ddnewhead_gcard"><a name="t_4" href="#" class="menu_btn" id="a_lipchannel" onmouseover="showgaoji(&#39;a_lipchannel&#39;,&#39;__ddnav_card&#39;);" onmouseout="hideotherchannel(&#39;a_lipchannel&#39;,&#39;__ddnav_card&#39;);" target="_blank">礼品卡</a>
				<div class="ddnewhead_gcard_panel" onmouseover="showgaoji(&#39;a_lipchannel&#39;,&#39;__ddnav_card&#39;)" onmouseout="hideotherchannel(&#39;a_lipchannel&#39;,&#39;__ddnav_card&#39;);" id="__ddnav_card">
					<ul class="ddnewhead_gcard_list">
						<li><a name="t_4_1" href="#" target="_blank">购买</a></li>
						<li><a name="t_4_2" href="#" target="_blank">激活</a></li>
					</ul>
				</div>
				</li>
				<li class="ddnewhead_separate"></li>
				<li><a name="ddheadmobile" href="#" target="_blank">手机当当</a></li>
				<li class="ddnewhead_separate"></li>
				<li><a name="t_5" href="#" target="_blank">企业销售</a></li>
				<li class="ddnewhead_separate"></li>
				<li class="help"><a name="t_6" href="#" target="_blank">帮助</a></li>
			</ul>
			<p id="nickname">
				欢迎光临当当网，请<a name="ddnav_login" href="#" target="_self" class="login_link">登录</a><a name="ddnav_register" href="#" target="_self" class="login_link">免费注册</a>
			</p>
		</div>
		<div class="ddnewhead_logo">
			<a href="#" title="返回首页" name="ddnav_logo"><img src="{{asset('register/ddnewhead_logo.gif')}}" alt="当当网"></a>
		</div>
		<div class="clear">
		</div>
	</div>
	<div class="ddnewcarthead_bottom">
	</div>
</div>
<form action="http://search.dangdang.com/search.aspx" id="bootpagetopSearch" name="bootpagetopSearch" method="GET">
</form>
<!-- 注册表单开始 -->
<form id="register_form" method="post" action="{{url('home/doregist')}}" onsubmit="return false;">
	<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
	<input type="password" style="display: none;">
	<div id="bd">
		<!--默认-->
		
		<div class="shadow_box">
			<div class="register_box">
				<div class="head">
					<span class="dd_more"><a href="#" class="home">当当首页</a><a href="#">注册帮助</a></span>
					<a href="#" class="head_a head_a1">新用户注册</a>
				</div>
				<div class="body">
				<form action="{{url('doregister')}}" method='post'>
					<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
					<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tbody>
					<tr>
						<td class="t">
							用户名
						</td>
						<td class="z_index2">
							<input name="userName" id="txt_username" autocomplete="off" maxlength="40" tabindex="1" value="" placeholder="请输入您的用户名" type="text" class="text"><span id="spn_username_ok"></span>
							<span id="J_tipUsername" class="cue warn"></span>
							
						</td>
					</tr>
					<tr>
						<td class="t">
							登录密码
						</td>
						<td>
							<label for="">
							<input name="password" id="txt_password" tabindex="2" type="password" class="text" maxlength="20">
							<span id="spn_password_ok" ></span>
							</label>
						</td>
					</tr>
					<tr>
						<td class="t">
							确认密码
						</td>
						<td>
							<input id="txt_repassword" name="surepassword" onpaste="return false" tabindex="3" type="password" class="text" maxlength="20">
							<span id="spn_repassword_ok" ></span>
							<span id="J_tipSurePassword" class="cue warn"></span>
						</td>
					</tr>
					
					<tr>
						<!-- 图形验证码 -->
						<td class="t j-vcode">
							验证码
						</td>
						<td class="j-vcode">
							<input class="text pin" type="text" id="txt_vcode" name="mycode" autocomplete="off" placeholder="请输入验证码" maxlength="5" tabindex="5">
							
							<img id="imgVcode" title="点击更换验证码" alt="点击更换验证码" width="124" height="37" src="{{url('admin/getcode')}}" onclick="this.src='{{url('admin/getcode')}}?id='+Math.random(); ">
							
							<span id="spn_vcode_ok"></span>
							<span id="J_tipVcode" class="cue warn"></span>
							<!--<span class="icon_wrong pin_i"></span>-->
						</td>
						
					</tr>
					<tr>
						<td class="t">
							&nbsp;
						</td>
						<td class="clause">
							<span class="float_l">
							<input id="chb_agreement" name="chb_agreement" onmouseover="this.style.cursor=&#39;pointer&#39;;this.style.cursor=&#39;hand&#39;;" tabindex="7" type="checkbox" checked="checked">我已阅读并同意
							<a target="_blank" href="#" tabindex="8">《当当交易条款》</a>和
							<a target="_blank" href="#" tabindex="9">《当当社区条款》</a>
							</span>
							<span id="J_tipAgreement" class="cue"></span>
						</td>
					</tr>
					<tr>
						<td class="t">
							&nbsp;
						</td>
						<td>
							<a id="J_submitRegister" href="#" class="btn_login" onclick="document.getElementById('register_form').submit();" tabindex="10">立即注册</a><a id="J_submitRegisterUnclick" style="display: none;" class="btn_login">注册中...</a>
						</td>
					</tr>
					</tbody>
					</table>
					{{csrf_field()}}
				</form>
				</div>
			</div>
		</div>
	</div>
	<input type="submit" id="btn_confirm" style="display: none">
	<input type="hidden" name="hdn_username" id="hdn_username">
	<input type="hidden" name="hdn_mobile" id="hdn_mobile">
	<input type="hidden" name="hdn_password" id="hdn_password">
	<input type="hidden" name="action_post" id="action_post" value="register">
	<input type="hidden" name="returnurl" id="returnurl" value="http://myhome.dangdang.com/">
</form>
<!-- 注册表单结束 -->
<input type="hidden" id="J_errorCode" value="">
<script type="text/javascript">
	$.ajaxSetup({
			headers: {
				'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')
			}
		});
	var nlabel = false;
	var plabel = false;
	var rlabel = false;
	var clabel = false;
	$('input[name=userName]').focus(function(){
			$(this).next('span').html('4-13位数字、字母或下划线,不能用数字开头').css('color','green');
		});
	//判断用户名是否已经存在
	$("input[name=userName]").blur(function(){
		var a = $(this);
		var userName = $(this).val();
		$.ajax({
			url:"/home/checkname",
			type:"post",
			data:{"userName":userName},
			success:function(mes){
				if(mes == "存在"){
					nlabel = false;
					a.next("span").html("用户名已存在！").css("color","red").show();
				}else if(mes == "不存在"){
					nlabel = true;
					a.next("span").html("用户名可用！").show();
				}else if(mes == "内容为空"){
					nlabel = false;
					a.next("span").html("用户名不能为空！").css("color","red").show();
				}
			}
		});
	});
	
	$("input[name=password]").focus(function(){
		$(this).next("span").html("密码位6-20个字符，可由英文、数字及符号组成").css("color","green").show();
	}).blur(function(){
		$(this).next("span").hide();
		var pass = $("input[name=password]").val();
		if(pass.match(/^\w{6,12}$/)==null){
			$(this).next("span").html("密码长度6-12个字符，请重新输入").css("color","red").show();
			//$(this).next("span").html('密码长度6-12个字符，请重新输入').css('color','red').show();
			plabel = false;
			//return false;
		}
	});
	
	$("input[name=surepassword]").focus(function(){
		$(this).next("span").html("请再次输入密码").css("color","green").show();
	}).blur(function(){
		$(this).next("span").hide();
	});
	
	//判断两次密码是否一致
		$('input[name=surepassword]').blur(function(){
			var repass = $(this).val();
			var a = $(this);
			var pass = $('input[name=password]').val();
			
			if($("input[name=surepassword]").val() != ""){
				if(repass == pass){
					a.next('span').html('密码一致').css('color','green').show();
					rlabel = true;
				}else{
					a.next('span').html('密码不一致').css('color','red').show();
					rlabel = false;
				}
			}
			
		});
		
	//判断验证码是否输入正确
		$('input[name=mycode]').blur(function(){
			var code = $(this).val();
			if($("input[name=mycode]").val() != ""){
				$.ajax({
					url:'/home/cregistercode',
					data:{'mycode':code},
					type:'post',
					//async:false,
					success:function(mes){
						if(mes == 'yes'){
							clabel = true;
							$('#spn_vcode_ok').html('&nbsp;&nbsp;验证码正确').css('color','green').show();
						}else if(mes == "no"){
							clabel = false;
							$('#J_tipVcode').html('验证码错误').css('color','red').show();
						}
						
					}
				});
			}
		}).focus(function(){
			$("#spn_vcode_ok").hide();
			$("#J_tipVcode").hide();
		});
	
	//满足以上条件才能提交
		$('form').submit(function(){
			if(nlabel & rlable & clabel){
				return true;
			}else{
				return false;
			}
		})
	
</script>
<!--页尾 开始 -->
<style type="text/css">
    .public_footer_box { width:100%; margin:0 auto; font:12px "\5b8b\4f53",Arial,Helvetica,sans-serif; clear:both;}
    .public_footer{ margin:0 auto; width:950px; padding:32px 5px 0;font:12px; color:#666; overflow:hidden;}
    .public_footer a{ color:#666!important; text-decoration:none; font-size:12px;}
    .public_footer a:hover{ color:#f60!important; text-decoration:underline;}
    .public_footer .sep{ display:inline-block; padding:0 18px;}
    .public_footer .footer_copyright{ padding-left:168px; margin:0 auto; width:792px; }
    .public_footer .footer_copyright span { float:left; display:inline}
    .public_footer .footer_copyright span{ padding-top:10px;}
    .public_footer .footer_copyright a { padding-right:4px;}
    .public_footer .footer_icon { margin:10px 0 0 335px;width:300px;height:57px;}
    .public_footer .validator,.public_footer .knet {float:left;display:inline;padding:0 5px;width:135px;height:47px;}
</style>
<div class="public_footer_box">
	<div class="public_footer">
		<div class="footer_copyright">
			<span>Copyright (C) 当当网 2004-2012, All Rights Reserved</span><span class="sep">|</span><span><a href="#" target="_blank">京ICP证041189号</a></span><span><a href="#" target="_blank">音像制品经营许可证 京音网8号</a></span>
			<div class="clear">
			</div>
		</div>
		<div class="footer_icon">
			<div class="validator">
				<a href="#" target="_blank" class="footer_img"><img src="{{asset('register/validate.gif')}}"></a>
			</div>
			<div class="knet">
				<!-- 可信网站LOGO安装开始 -->
				
				<a href="#" tabindex="-1" id="urlknet" target="_blank">
				<img width="128" height="47" alt="可信网站" name="CNNIC_seal" border="true" src="{{asset('register/knetSealLogo.png')}}" oncontextmenu="return false;" onclick="">
				</a>
				<!-- 可信网站LOGO安装结束 -->
			</div>
			<div class="clear">
			</div>
		</div>
	</div>
</div>
<!--页尾 end -->

</body>
</html>